#include <stdio.h>

int swap1(int *a, int *b) {// 能交换外部的值
    int tmp = *a;
    *a = *b;
    *b = tmp;
}


int swap3(int a, int b) { // 不能交换外部的值
    int tmp = a;
    a = b;
    b = tmp;
}

int main() {
    printf("Hello, World!\n");
    printf("享学C语言基础!\n");

    char c = 128;
    printf("%d\n", c);
    // 把整数读作signed char 或 unsigned char
    printf("%hhd\n", c);
    // short int
    printf("%hd\n", c);
    // unsigned short
    printf("%hu\n", c);


    printf("==================== \n");
    printf("int size : %lu \n", sizeof(int));


    int intA = 10;
    int intC = 20;

    printf("a: %d  c: %d\n", intA, intC);
    swap1(&intA, &intC);
    printf("a: %d  c: %d\n\n", intA, intC);


    printf("a: %d  c: %d\n", intA, intC);
    swap3(intA, intC);
    printf("a: %d  c: %d\n\n", intA, intC);

    return 0;
}


